import axios from 'axios'
axios.defaults.baseURL='https://dbyxs.xyz:8002'
let gogins=function(params){
   return axios.post('/getuser',params)
}
//查询商品
let getgoods=function(params){
    return axios.post('/goods/list',params)
}
//查询单个商品
let getupdategoods=function(params){
    return axios.post('/goods/detail',params)
}
//修改商品
let getUpdate=function(params){
    //,{headers: { 'Content-Type': 'application/x-www-form-urlencoded' }}
    return axios.post('/goods/update/list',params)
}
//查询商品分类
let getgoodstype=function(params){
    return axios.post('/goods',params)
}
//查询会员列表
let getuserlist=function(params){
    return axios.post('/user/admin',params)
}
//,{headers:{"Content-Type":"application/x-www-form-urlencoded;"}}
//修改会员信息
let getuserupdate=function(params){
    return axios.post('/user/admin/update',params)
}
//校验用户密码
let getpassword=function(params){
    return axios.post('/user/admin/password',params)
}
//根据token查询用户信息
let getToken=function(params){
    return axios.post('/user/token',params)
}
//根据用户名查询用户信息
// let getUser=function(params){
//     return axios.post('')
// }
//添加个人语音
let addAudio=function(params){
    return axios.post('/audio/add',params)
}
//查询个人语音记录
let getUserAudio=function(params){
    return axios.post('/audio/get',params)
}
//文字转语音
let getAudio=function(params){
    return axios.get(`https://dbyxs.xyz:3001/api/audio?text=${params.text}`)
}
//添加个人视频
let getAdduserVideo=function(params){
    return axios.post('/video',params)
}
//添加视频地址
let getAddVideo=function(params){
    return axios.post('/upload/video',params,{headers: { 'Content-Type': 'multipart/form-data' }})
}
//查询个人视频
let getvideo=function(params){
    return axios.post('/video/get',params)
}
//添加个人文件
let getAddFile=function(params){
    return axios.post('/api/file',params,{headers: { 'Content-Type': 'multipart/form-data' }})
}
//查询个人文件
let getfile=function(params){
    return axios.post('/file/get',params)
}
export default {
    gogins,
    getgoods,
    getupdategoods,
    getUpdate,
    getgoodstype,
    getuserlist,
    getuserupdate,
    getpassword,
    getToken,
    addAudio,
    getAudio,
    getUserAudio,
    getAdduserVideo,
    getAddVideo,
    getvideo,
    getAddFile,
    getfile
}